package com.sh.data.engine.domain.base.model.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * @author：jingchen.hr
 * @descripion:
 * @data:2/22/20223:19 PM
 */
public enum ThemeEnum {
    ODS("ods", "ods", "贴源层"),
    DWD("dwd", "dwd", "公共层"),
    ADS("ads", "ads", "应用层"),
    TMP("tmp", "tmp", "其他层"),
    INDEXLIB("indexlib", "indexlib", "指标管理");

    private String code;
    private String prefix;
    private String name;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private ThemeEnum(String code, String prefix, String name) {
        this.code = code;
        this.prefix = prefix;
        this.name = name;
    }

    public static ThemeEnum getByName(String name) {
        if (StringUtils.isBlank(name)) {
            return null;
        }
        for (ThemeEnum value : ThemeEnum.values()) {
            if (StringUtils.equals(value.name, name)) {
                return value;
            }
        }
        return null;
    }
}
